<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<title>Selezione Istanze</title>
	<link rel="stylesheet" type="text/css" href="../styles/style.css" />
</h:head>
<h:body>
<div id="container">
<div id="box">
<header class="banner">
<span id="titoloPagina"> ??? </span>
</header>
<div id="externalborder1">
<p:spacer height="40px" />


<h:form id="form"> 
      
      <p:growl id="growl" showDetail="true" sticky="true" />
			<h:panelGroup  >
			<div id="infoAgg" style="text-align: center;">
			<h:outputText value="Il viaggio risulta già pagato!" rendered="#{param.giaPagato}"/><br/>
			</div>
			</h:panelGroup>
			<p:spacer height="40px" />

	<p:panel header="Istanze"> 
		<p:dataTable id="istanzeSel" var="istanzaDTO" rowKey="#{istanzaDTO.idIstanza}" value="#{pagamentoPP.istanze}" paginator="true" 
                 selection="#{pagamentoPP.istanzaTmp}" selectionMode="single" >  
  
  
   		
			<p:ajax event="rowSelect" update=":form:growl" listener="#{pagamentoPP.onRowSelectIstanza}"/>

   		
		    <p:column headerText="TipoElemento">  
	            <h:outputText value="#{istanzaDTO.elemento.tipo}" />  
	        </p:column> 
	        
	         <p:column headerText="Nome">  
	            <h:outputText value="#{istanzaDTO.elemento.nome}" />  
	        </p:column>
	        
	        <p:column headerText="DataInizio">  
	            <h:outputText value="#{istanzaDTO.dataInizio}">  
                <f:convertDateTime pattern="dd/MM/yyyy HH:mm" />      
            </h:outputText>    
	        </p:column>  
	   
  
	        <p:column headerText="DataFine">  
	            <h:outputText value="#{istanzaDTO.dataFine}" >  
                <f:convertDateTime pattern="dd/MM/yyyy HH:mm" />      
            </h:outputText>    
	        </p:column>  
	       
	        <p:column headerText="Prezzo">  
	            <h:outputText value="#{istanzaDTO.prezzo}" />  
	        </p:column>
	        
	         <p:column headerText="Citta">  
	            <h:outputText value="#{istanzaDTO.elemento.città}" />  
	        </p:column> 
	       
	      
	        
	        <p:column headerText="Multy">  
	            <h:outputText value="#{istanzaDTO.elemento.multy}" />  
	        </p:column> 
	        
	    
	        
	    </p:dataTable>
    </p:panel>
    
 </h:form>   
    <p:panel>
		<p:button value="Torna alla home" outcome="index"></p:button>
		<p:commandButton value="Riepilogo da Pagare"  action="#{pagamentoPP.getIstanzeDaPagare()}"/>
		<p:commandButton value="Partecipa al Viaggio" action="#{pagamentoPP.recuperaViaggio()}"/>
	
	</p:panel>
</div>
</div>
<div id="push">
</div>
</div>
<div id="footer">
</div>

</h:body>   

    
</html>